// 饼形图2 地区分布模块
(function() {
  var myChart = echarts.init(document.querySelector(".OD .chart"));
  var option = {
    color: [
      "#006cff",
      "#60cda0",
      "#ed8884",
      "#ff9f7f",
      "#0096ff",
      "#9fe6b8",
    ],
    tooltip: {
      trigger: "item",
      formatter: "{a} <br/>{b} : {c} ({d}%)"
    },
    legend: {
      bottom: "0%",
      itemWidth: 10,
      itemHeight: 10,
      textStyle: {
        color: "rgba(255,255,255,.5)",
        fontSize: "12"
      }
    },
    series: [
      {
        name: "出行分布",
        type: "pie",
        radius: ["10%", "70%"],
        center: ["50%", "50%"],
        roseType: "radius",
        // 图形的文字标签
        label: {
          fontSize: 10
        },
        // 链接图形和文字的线条
        labelLine: {
          // length 链接图形的线条
          length: 6,
          // length2 链接文字的线条
          length2: 8
        },
        data: [
          { value: 7.18, name: "岛内-岛内-非共线-非共线" },
          { value: 12.89, name: "岛内-岛外-非共线-岛外" },
          { value: 14.63, name: "岛内-岛内-共线-共线" },
          { value: 15.19, name: "岛内-岛内-共线-非共线" },
          { value: 19.09, name: "岛外-岛外" },
          { value: 31.04, name: "岛内-岛外-共线-岛外" },
        ]
      }
    ]
  };
  myChart.setOption(option);
  // 监听浏览器缩放，图表对象调用缩放resize函数
  window.addEventListener("resize", function() {
    myChart.resize();
  });
})();